package test.past;

public class StaticInitialization {
	public static void main(String[] args) {
		System.out.println("createing new Cupboard() in main");
		new Cupboard();
		
		System.out.println("createing new Cupboard() in main");
		new Cupboard();
		
		table.f2(1);
		cupboard.f3(1);
	}
	static Table table=new Table();
	static Cupboard cupboard=new Cupboard();
}


class Bowl{
	Bowl(int maker){
		System.out.println("Bowl("+maker+")");
	}
	void f1(int maker){
		System.out.println("f1("+maker+")");
	}
}

class Table{
	static Bowl bow1=new Bowl(1);
	Table(){
		System.out.println("table()");
		bow2.f1(1);
	}
	void f2(int maker){
		System.out.println("f2("+maker+")");
	}
	static Bowl bow2=new Bowl(2);
}

class Cupboard{
	Bowl bow3=new Bowl(3);
	static Bowl bow4=new Bowl(4);
	Cupboard(){
		System.out.println("cupboard()");
		bow4.f1(2);
	}
	void f3(int maker){
		System.out.println("f3("+maker+")");
	}
	static Bowl bow5=new Bowl(5);
}

